#pragma once

class TaskThread;
class WuDong;
enum TaskStatus
{
    TaskStatus_Uninitialized = 0,
    TaskStatus_Running,
    TaskStatus_Finished,
    TaskStatus_Aborted,
};
class BaseTask
{
public:
    BaseTask();
    virtual ~BaseTask();

    void initialize(TaskThread *taskThread);

public:
    /**
     * @brief 任务运行函数
     * @return true  任务运行完成,不再执行这个任务了
     * @return false 任务运行未结束，还会继续调用
     */
    virtual bool run() = 0;

    WuDong &wd();

    bool getRolePos(long &x, long &y);

    bool isRoleMoving();

    /**
     * @brief 攻击怪物
     * @return true  正在攻击
     * @return false 没有怪物了
     */
    bool attackMonster();

    int role_x_;
    int role_y_;

protected:
    TaskThread *m_taskThread;
};